﻿Public Class fListaBancos
    Dim daBancos As lbGlobalcom.dsBancosTableAdapters.GLO_BANCOSTableAdapter
    Private lIdBanco As String
    Public ReadOnly Property idBco() As String
        Get
            Return lIdBanco
        End Get
    End Property
    Private Sub fListaBancos_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Try
            daBancos = New lbGlobalcom.dsBancosTableAdapters.GLO_BANCOSTableAdapter
            daBancos.FillByOrderDecrip(DsBancos.GLO_BANCOS)
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
    End Sub
    Private Sub SelectBanco()
        If lstBancos.SelectedValue IsNot Nothing Then
            lIdBanco = lstBancos.SelectedValue
            Me.DialogResult = Windows.Forms.DialogResult.OK
        End If
    End Sub

    Private Sub lstBancos_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles lstBancos.KeyDown
        If e.KeyCode = Keys.Enter Then
            SelectBanco()
        End If
    End Sub
    Private Sub lstBancos_MouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles lstBancos.MouseDoubleClick
        SelectBanco()
    End Sub
End Class